import fs from "fs";
import process from "process";

fs.createReadStream(process.cwd() + '/src/0020_文件/data.txt', 'utf-8')
    .on('open', (fd) => {
        console.log("文件打开了", fd);
    })
    .on('data', (chunk: string) => {
        console.log('读取数据', chunk.substring(0, 100));
    })
    .on('error', (err => {
        console.log('出错了', err);
    }))
    .on('end', () => {
        console.log('读完了');
    })
    .on('close', () => {
        console.log('关闭了');

    })
    .on('ready', () => {
        console.log('read');
    })
// .on('readable', () => {
//     console.log('readable');

// })


